const key = 'token'
const user = 'userInfo'
export function set (value) {
  localStorage.setItem(key, value)
}
export function get () {
  return localStorage.getItem(key)
}
export function del () {
  localStorage.removeItem(key)
}

export function setUserInfo (value) {
  value = JSON.stringify(value)
  localStorage.setItem(user, value)
}

export function getUserInfo () {
  const userInfo = localStorage.getItem(user)
  return JSON.parse(userInfo)
}
export function delUserInfo () {
  localStorage.removeItem(user)
}
